import React from 'react';
import { Form } from 'antd';
import { AxCreateForm } from '@/components/AxForm/AxCreateForm';
import { AxLabel } from '@/components/AxForm/AxFormItem';
import { axurl } from '@/shared/axurl';
import { AxUpload } from '@/components/AxForm/AxFormItem/AxUpload';

const Import: React.FC<any> = props => {
    const { form, ...rest } = props;

    return (
        <AxCreateForm
            form={form}
            title='导入商品'
            {...rest}
            items={[
                <AxUpload
                    form={form}
                    label="文件"
                    field="attachmentIds"
                    uploadUrl={axurl.comm.uploadFile}
                    required
                />,
                <AxLabel form={form} label="导入模板" field="template">
                    <a href={axurl.template.charge_tuition_fee_collect} target="_blank">
                        数据导入模板.xlsx
                  </a>
                </AxLabel>,
            ]}
        />
    );
};

export default Form.create<any>()(Import);
